<?php
// +------------------------------------------------------------------------------
// | TODO:自定义公共函数库--直接对表进行操作M/D('TableName')
// +-------------------------------------------------------------------------------
// | CreateTime:2016-01-01
// +-------------------------------------------------------------------------------
// | Author: JieHuiLong <jiehuilong@icloud.com> WebSite:<http://www.jiehuilong.com>
// +-------------------------------------------------------------------------------
/**
 * 根据PID获取地区列表
 * @param  integer $pid [0~4]
 * @return [Array]       [Data]
 */
function getDirtrictList($pid = 0){
    $list = M("district")->where(array('pid'=>$pid))->select();
    return $list;
}
/**
 * [get_dirtrict 根据ID查询地区名]
 * @param  [type] $id [ID]
 * @return [type]     [地区名称]
 */
function getDirtrict($id){
    $info = M("district")->field('name')->getById($id);
    return $info['name'];
}
/**[check_mobile 查询用户表手机号是否存在]
 * @param  [string]
 * @return [bool]
 */
function checkMobile($number){
    $info = M("ucenter_member")->field('mobile')->where(array('mobile'=>$number))->find();
    if($info){
    	return true;
    }else{
    	return false;
    }
}
function checkEmail($str){
	$info = M("ucenter_member")->field('email')->where(array('email'=>$str))->find();
	if($info){
		return true;
	}else{
		return false;
	}
}
